package com.entity;

import lombok.Data;

@Data
public class Cart {
    private Integer id;
    private String name;
    private String photo;
    private int price;//单价
    private int number;
    private int customers_id;
    private int food_id;
    private int size;
    private int subtotal;//小计
    private int amount;//总计
    private String fall;

    public int getSubtotal() {

        return price+getSize();
    }

    public void setSubtotal(int subtotal) {

        this.subtotal = price+getSize();
    }

    public int getAmount() {
        return getNumber()*getSubtotal();
    }

    public void setAmount(int amount) {
        this.amount = getNumber()*getSubtotal();
    }
}
